﻿using System;
using System.Windows.Forms;
using Umbrella.Whs.Contracts;

namespace Umbrella.Whs.WhsAddin.ConsoleControls
{
    public partial class ConsoleControlBase : UserControl
    {
        protected readonly log4net.ILog _log;
        protected readonly SingletonServiceFactory _singletonService = new SingletonServiceFactory();
        protected readonly UmbrellaConsoleTab _tab;

        /// <summary>
        /// for designer only
        /// </summary>
        [Obsolete("for designer only")]
        internal ConsoleControlBase()
        {
            InitializeComponent();
        }

        public ConsoleControlBase(UmbrellaConsoleTab tab)
        {
            if (tab == null)
                throw new ArgumentNullException("tab");

            _tab = tab;

            if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
            {
                _log = log4net.LogManager.GetLogger(GetType());
            }

            InitializeComponent();
        }
    }
}


